<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php if (!session_id()) session_start();date_default_timezone_set('PRC'); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="demo.css" rel="stylesheet" type="text/css" />
    <script src="scripts/boot.js" type="text/javascript"></script>
</head>
<body >


 <div id="htmlContent" style="padding-left:10px;;">
      模版:<input  id='rbl' class="mini-combobox" style="width:150px;" textField="text" valueField="id" emptyText="请选择..."
    data="[{id:'default',text:'默认模版'},{id:'zhongyin',text:'中银'},{id:'shyinhang',text:'上海银行'}]" value="default"  required="true" allowInput="true" showNullItem="true" nullItemText="请选择..."/>
     <br/>
      文件格式: <div id='rbl2'  class="mini-radiobuttonlist" repeatItems="1" repeatLayout="table" repeatDirection="vertical"
    textField="text" valueField="id" value="zip" 
    data="[{id:'txt',text:'文本'},{id:'zip',text:'压缩包'}]" >
</div> 
<input  id='select' class='mini-textbox' style="display: none"/>
 </div>
  <a class="mini-button" onclick="download()" enabled="" id='query-bt' >&nbsp;&nbsp;下载数据包&nbsp;&nbsp;</a>
</body>
<script type="text/javascript">
        mini.parse();

        function SetData(data) {
         mini.get('select').setValue(data.data);
        }
        function download(){
       	 var model = mini.get("rbl").getValue();
         var type  = mini.get("rbl2").getValue();
         var data  = mini.get("select").getValue();
         $.ajax({
             url: "/goods/download",
             data: { model: model,type:type,data:data},
             type: "post",
             dataType:'json',
             success: function (data) {
               window.open(data.path+data.file_name);
             },
             error: function (jqXHR, textStatus, errorThrown) {
                 alert(jqXHR.responseText);
             }
         });
         
            }
    </script>

</html>